home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
tools
/
czesc_1
/
cookie
/
cookhash.lex
< prev
next >
Wrap
Text File
|
1995-04-27
|
634b
|
51 lines
/*
* cookhash 2.0
* Jörgen Grahn 1995-04-27
*
* generates file for random selection of cookies
* from a fortune cookie file
*
* cookhash <cookiefile >hashfile
*
* format of the cookie file:
*
* comment
* cookie
* comment
* cookie
* ...
* comment
* cookie
*
* where 'comment' is a bunch of rows starting with '%%'
*
*
* Compile with 'flex' and then an ANSI C compiler.
*
*/
int filepos = 0;
static char verstring[] = "$" "VER: cookhash 2.0 (27.4.95)";
%%
(\%\%.*\n)+ {
filepos += yyleng;
printf("%06lx\n",filepos);
}
(.|\n) {
filepos += yyleng;
}
%%
main()
{
yylex();
exit(0);
}